package com.example.nuc_ms_beta.ui.viewconstruction.moderfragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by 张博川 on 2016/8/30.
 * 咨询  子模块设置 （这只是一个简单的例子）
 */
public class VpSimpleFragment extends Fragment {
    private String title;
    public static final String BUNDLE_TITLE = "title";


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        Bundle bundle = getArguments();
        if (bundle != null) {
            title = bundle.getString(BUNDLE_TITLE);
        }
        TextView tv = new TextView(getActivity());
        tv.setText(title);
        tv.setTextSize(30);
        tv.setGravity(Gravity.CENTER);
        return tv;

    }

    public static VpSimpleFragment newInstance(String title) {
        Bundle bundle = new Bundle();
        bundle.putString(BUNDLE_TITLE, title);
        VpSimpleFragment fragment = new VpSimpleFragment();
        fragment.setArguments(bundle);
        return fragment;
    }
}
